<template>
  <el-tabs v-model="activeNameHuiqian" @tab-click="tabClick" tab-position="left">
    <el-tab-pane name="Fangan">
        <span slot="label">方案 <i class="el-icon-caret-bottom"></i></span>
        <div v-if="huiqiandata.HQ_FangAnBaoSong&&huiqiandata.HQ_FangAnBaoSong.length>0">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:9999" type="success">查看质量评估</el-button>
        </div>
        <!-- <div v-if="huiqiandata.Fangan.CanRead">
          <el-button  @click="pdfshow()" type="primary">查看完整方案</el-button>
        </div>
        <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div> -->
        <div v-if="huiqiandata.HQ_FangAnBaoSong&&huiqiandata.HQ_FangAnBaoSong.length>0">
          <h1>方案报送及审核情况</h1>

          <el-card v-for="(item, index) in huiqiandata.HQ_FangAnBaoSong" :key="index" keys class="" style="margin:0 0 20px 0">
            <div slot="header" class="clearfix">
              <span><b>审核单位：</b><font style="color:#00f">{{item.Shenhedanwei}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span><b>报送次数：</b> 共 <font style="color:#00f">{{item.Shangbaocishu}}</font> 次</span>
            </div>
            <div v-if="item.Fankuiyijian.length>0">
              <div class="text item" style="line-height:180%;font-weight:bolder">
                历次反馈意见：
              </div>
              <el-table :data="item.Fankuiyijian" highlight-current-row v-loading="sublistLoading" style="width: 100%;margin:10px 0;">
                <el-table-column type="index" label="次数" width="70">
                </el-table-column>
                <el-table-column label="反馈时间" width="150">
                  <template slot-scope="scope">
                    {{MyGetDateStr(scope.row.TheTime)}}
                  </template>
                </el-table-column>
                <el-table-column prop="Person" label="反馈人" width="100">
                </el-table-column>
                <el-table-column prop="YiJian" label="反馈意见">
                </el-table-column>
              </el-table>
            </div>
            <div class="text item" style="line-height:180%;font-weight:bolder">
              民主生活会工作方案：
            </div>
            <div class="text item" style="line-height:180%">
                <span v-if="item.FileName&&item.FileName.length>0">
                  <div v-for="(filename,index) in item.FileName" :key="index">
                    <a href="javascript:void(0)" @click="showfile(filename,item.FilePathName[index])">{{filename}}</a><br>
                  </div>
                </span>
                <span v-else>无</span>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            </div>
            <div class="text item" style="line-height:180%;font-weight:bolder">
              备注：
            </div>
            <div class="text item" style="line-height:180%">
              {{item.Remark}}
            </div>
          </el-card>
        </div>
    </el-tab-pane>
    <el-tab-pane name="HQ_XueXi">
      <span slot="label">学习研讨 <i class="el-icon-caret-bottom"></i></span>
        <div v-if="huiqiandata.HQ_XueXi&&huiqiandata.HQ_XueXi.length>0">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>
          <div style="padding:10px 0;">共 <b>{{huiqiandata.HQ_XueXi.length}}</b> 条</div>
          <el-card v-for="(item, index) in huiqiandata.HQ_XueXi" :key="index" keys class="" style="margin:0 0 20px 0">
            <div slot="header" class="clearfix">
              <span><b>{{index+1}}. 学习内容：</b></span>
            </div>
            <div class="text item" style="line-height:180%" v-html="item.Neirong">
            </div>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            <div>
              <span><b>学习类型：</b><font style="color:#00f">{{item.Thetype}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span><b>会议形式：</b><font style="color:#00f">{{item.Huiyixingshi}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span><b>学习时间：</b><font style="color:#00f">{{item.Shijian}}</font></span>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            </div>
            <div class="text item" style="line-height:180%;font-weight:bolder">
              备注：
            </div>
            <div class="text item" style="line-height:180%">
              {{item.Remark}}
            </div>
          </el-card>
        </div>
        <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
    </el-tab-pane>
    <el-tab-pane name="HQ_YiJian">
      <span slot="label">征求意见 <i class="el-icon-caret-bottom"></i></span>
        <div v-if="(huiqiandata.HQ_YiJianZongJie&&huiqiandata.HQ_YiJianZongJie.length>0)||(huiqiandata.HQ_YiJianYuanShi&&huiqiandata.HQ_YiJianYuanShi.length>0)">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed" type="success">查看质量评估</el-button>
        <!-- <el-radio-group v-model="YijianDuixiang" style="margin:20px">
          <el-radio-button label="全部"></el-radio-button>
          <el-radio-button v-for="(item, index) in huiqiandata.HQ_YiJian_Duixiang" :key="index" keys :label="item" ></el-radio-button>
        </el-radio-group> -->
        <!-- 共 <b>{{dxfilterList.length}}</b> 项 -->
      <!-- <div v-if="this.YijianDuixiang==='全部（总结提炼）'">
        <div v-if="huiqiandata.HQ_YiJianZongJie && huiqiandata.HQ_YiJianZongJie.length > 0">
          <el-card v-for="(item, index) in huiqiandata.HQ_YiJianZongJie" :key="index" keys class="" style="margin:0 0 20px 0">
            <div slot="header" class="clearfix">
              <span><b>意见对象：</b><font style="color:#00f">{{item.Yijianduixiang}}</font></span>
            </div>
            <div class="text item" style="line-height:180%;font-weight:bolder">
              意见主要内容（{{item.Tiaoshu}}条）：
            </div>
            <div class="text item" style="line-height:180%" v-html="item.Yijianneirong">
            </div>
            <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            <div class="text item" style="line-height:180%">
              <span><b>反馈时间：</b>{{item.Fankuishijian}}</span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span><b>反馈人员姓名：</b>{{item.Fankuixingming}}</span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span><b>反馈方式：</b>{{item.Fangshi}}</span>
            </div>
            <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            <div class="text item" style="line-height:180%;font-weight:bolder">
              备注：
            </div>
            <div class="text item" style="line-height:180%">
              {{item.Remark}}
            </div>
          </el-card>
        </div>
        <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
      </div> -->
      <div>
        <div v-if="huiqiandata.HQ_YiJianYuanShi && huiqiandata.HQ_YiJianYuanShi.length > 0">
          <el-card v-for="(item, index) in dxfilterList" :key="index" keys class="" style="margin:0 0 20px 0">
            <div slot="header" class="clearfix">
              <!-- <span><b>征集对象：</b><font style="color:#00f">{{item.Fanwei}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp; -->
              <span><b>征求意见范围：</b><font style="color:#00f">{{item.Fanweileixing}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span><b>征集时间段：</b>{{item.Shijian}}</span>
            </div>
            <!-- <div v-if="item.Zidingyifanwei&&item.Zidingyifanwei.length>0">
              <div class="text item" style="line-height:180%;font-weight:bolder">
                征求意见单位名单：
              </div>
              <div class="text item" style="line-height:180%">
                <div v-for="(itemdanwei,index) in item.Zidingyifanwei" :key="index">{{index+1}}.{{itemdanwei}}</div>
              </div>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            </div> -->
            <!-- <div class="text item" style="line-height:180%;font-weight:bolder">
              意见主要内容（{{item.Tiaoshu}}条）：
            </div> -->
            <div class="text item" style="line-height:180%">统计 <font style="color:#00f">{{item.Fanwei}}</font> 家单位，征集到 <font style="color:#00f">{{item.Neirong}}</font> 条原汁原味意见，总结概括为 <font style="color:#00f">{{item.Yijianfankuiqingkuang}}</font> 条意见
            </div>
            <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            <!-- <div class="text item" style="line-height:180%;">
              <span><b>意见反馈情况：</b>{{item.Yijianfankuiqingkuang}}</span>
            </div>
            <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden"> -->
            <div class="text item" style="line-height:180%">
              <span>
                <b>附件：</b>
                <span v-if="item.FileName&&item.FileName.length>0">
                  <div v-for="(filename,index) in item.FileName" :key="index">
                    <a href="javascript:void(0)" @click="showfile(filename,item.FilePathName[index])">{{filename}}</a><br>
                  </div>
                </span>
                <span v-else>无</span>
              </span>
            </div>
            <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            <div class="text item" style="line-height:180%;font-weight:bolder">
              备注：
            </div>
            <div class="text item" style="line-height:180%">
              {{item.Remark}}
            </div>
          </el-card>
        </div>
        <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
      </div>
      </div>
      <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
    </el-tab-pane>
    <el-tab-pane name="HQ_TanHua">
      <span slot="label">开展谈心谈话 <i class="el-icon-caret-bottom"></i></span>
        <div v-if="huiqiandata.HQ_TanHua && huiqiandata.HQ_TanHua.length>0">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed" type="success">查看质量评估</el-button>
          <div v-if="huiqiandata.HQ_TanHua && huiqiandata.HQ_TanHua.length > 0">
            班子领导：
            <el-radio-group v-model="BanziPersonName" style="margin:20px" @change="changetopersonlist">
              <el-radio-button label="全部"></el-radio-button>
              <el-radio-button v-for="(item, index) in huiqiandata.HQ_TanHua_LingDao" :key="index" keys :label="item.Name" ></el-radio-button>
            </el-radio-group> 共 {{filterList.length}} 项
            <div></div>
            谈话对象：
            <el-radio-group v-model="TanhuaDuixiang" style="margin:20px">
              <el-radio-button label="全部"></el-radio-button>
              <el-radio-button v-for="(item, index) in topersonlist" :key="index" keys :label="item.Name" ></el-radio-button>
            </el-radio-group>
            <el-card v-for="(item, index) in filterList" :key="index" keys class="" style="margin:0 0 20px 0">
              <div slot="header" class="clearfix">
                <span><b>班子成员姓名：</b><font style="color:#00f">{{item.BanziPersonName}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
                <span><b>谈话时间：</b>{{item.Shijian}}</span>
              </div>
              <div class="text item" style="line-height:180%">
                <span><b>谈话对象：</b><font style="color:#00f">{{item.Duixiang}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
                <span><b>谈话类型：</b>{{item.Leixing}}</span>
              </div>
              <!-- <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
              <div class="text item" style="line-height:180%;font-weight:bolder">
                谈话内容：
              </div>
              <div class="text item" style="line-height:180%" v-html="item.Neirong">
              </div> -->
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
              <div class="text item" style="line-height:180%;font-weight:bolder">
                备注：
              </div>
              <div class="text item" style="line-height:180%">
                {{item.Remark}}
              </div>
            </el-card>
          </div>
          <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
      </div>
      <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
    </el-tab-pane>
    <!-- <el-tab-pane name="HS_BanZiWenTi">
      <span slot="label">上年班子问&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>题整改落实 <i class="el-icon-caret-bottom"></i></span>
          <div v-if="huiqiandata.HS_BanZiWenTi && huiqiandata.HS_BanZiWenTi.length > 0">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>
          <div style="padding:10px 0;">共 <b>{{huiqiandata.HS_BanZiWenTi.length}}</b> 条</div>
            <el-card v-for="(item, index) in huiqiandata.HS_BanZiWenTi" :key="index" keys class="" style="margin:20px 0 0 0;clear:both;overflow:hidden">
              <div slot="header" class="clearfix" style="line-height:180%;">
                <span><b>上年存在问题&nbsp;{{index+1}}：</b><div v-html="item.Wenti"></div></span>
              </div>
              <div class="text item" style="line-height:180%;font-weight:bolder">
                整改落实情况：
              </div>
              <div class="text item" style="line-height:180%" v-html="item.Cuoshi">
              </div>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
              <div class="text item" style="line-height:180%">
                <span><b>是否完成：</b>{{item.Shifouwancheng}}</span>
              </div>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
              <div class="text item" style="line-height:180%;font-weight:bolder">
                备注：
              </div>
              <div class="text item" style="line-height:180%">
                {{item.Remark}}
              </div>
            </el-card>
          </div>
          <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
    </el-tab-pane> -->
    <el-tab-pane name="HQ_CaiLiaoBanZi">
      <span slot="label">班子材料&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>及审核情况 <i class="el-icon-caret-bottom"></i></span>
        <div v-if="huiqiandata.HQ_CaiLiaoBanZi&&huiqiandata.HQ_CaiLiaoBanZi.length>0">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>

          <el-card v-for="(item, index) in huiqiandata.HQ_CaiLiaoBanZi" :key="index" keys class="" style="margin:0 0 20px 0">
            <div slot="header" class="clearfix">
              <span><b>审核方式：</b><font style="color:#00f">{{item.HuiyiMingcheng}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span v-show="item.HuiyiMingcheng==='会议审核'"><b>会议次数：</b><font style="color:#00f">{{item.Yanjiuhuiyi}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span v-show="item.HuiyiMingcheng==='会议审核'"><b>主持人：</b><font style="color:#00f">{{item.Zhuchiren}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span v-show="item.HuiyiMingcheng==='会议审核'"><b>会议时间：</b><font style="color:#00f">{{MyGetDateStr(item.Huiyishijian)}}</font></span>
            </div>
            <div v-show="item.HuiyiMingcheng==='会议审核'">
              <span><b>参加人：</b><font style="color:#00f">{{item.Canjiaren}}</font></span>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            </div>
            <div style="line-height:180%">
              <span><b>有无不同意见：</b><font style="color:#00f">{{item.Butongyijian}}</font></span><br>
              <span><b>是否从要求的方面查摆问题：</b><font style="color:#00f">{{item.Shifoucongyaoqiu}}</font></span><br>
              <span><b>整改措施是否对着问题去，可操作，能落实：</b><font style="color:#00f">{{item.Shifoukecaozuo}}</font></span><br>
              <span><b>主题是否符合通知要求：</b><font style="color:#00f">{{item.Shifoufuhetongzhi}}</font></span><br>
              <span><b>是否既摆事实讲情况，又进行深刻党性分析，见人见事见思想：</b><font style="color:#00f">{{item.Shifoubaishishi}}</font></span>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            </div>
            <div class="text item" style="line-height:180%;font-weight:bolder">
              班子对照检查材料：
            </div>
            <div class="text item" style="line-height:180%">
                <span v-if="item.FileName&&item.FileName.length>0">
                  <div v-for="(filename,index) in item.FileName" :key="index">
                    <a href="javascript:void(0)" @click="showfile(filename,item.FilePathName[index])">{{filename}}</a><br>
                  </div>
                </span>
                <span v-else>无</span>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            </div>
            <div class="text item" style="line-height:180%;font-weight:bolder">
              相关会议纪要或记录扫描件：
            </div>
            <div class="text item" style="line-height:180%">
                <span v-if="item.FileName2&&item.FileName2.length>0">
                  <div v-for="(filename,index) in item.FileName2" :key="index">
                    <a href="javascript:void(0)" @click="showfile(filename,item.FilePathName2[index])">{{filename}}</a><br>
                  </div>
                </span>
                <span v-else>无</span>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            </div>
            <div class="text item" style="line-height:180%;font-weight:bolder">
              备注：
            </div>
            <div class="text item" style="line-height:180%">
              {{item.Remark}}
            </div>
          </el-card>
      </div>
      <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
    </el-tab-pane>
    <el-tab-pane name="HQ_CaiLiaoChengYuan">
      <span slot="label">班子成员材料 <i class="el-icon-caret-bottom"></i></span>
        <div v-if="huiqiandata.HQ_CaiLiaoChengYuan&&huiqiandata.HQ_CaiLiaoChengYuan.length>0">
          <div style="padding:10px 0;">共 <b>{{huiqiandata.HQ_CaiLiaoChengYuan.length}}</b> 条</div>
          <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>

          <el-card v-for="(item, index) in huiqiandata.HQ_CaiLiaoChengYuan" :key="index" keys class="" style="margin:0 0 20px 0">
            <div slot="header" class="clearfix">
              <span><b>{{index+1}}. 姓名：</b><font style="color:#00f">{{item.BanziPersonName}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span><b>对照检查材料名称：</b><font style="color:#00f">{{item.Cailiaomingcheng}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
              <span><b>审阅人：</b><font style="color:#00f">{{item.Shenyueren}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
              <!-- <span><b>修改次数：</b><font style="color:#00f">{{item.Xiugaicishu}}</font></span> -->
            </div>
            <!-- <div style="line-height:180%">
              <span><b>查摆问题是否遵循“三个摆进去”和防止“五个代替”：</b><font style="color:#00f">{{item.Shifoubaijinqu}}</font></span><br>
              <span><b>个人发言提纲是否既摆事实讲情况，又进行深刻党性分析，见人见事见思想：</b><font style="color:#00f">{{item.Shifoubaishishi}}</font></span><br>
              <span><b>整改措施是否对着问题去，可操作，能落实：</b><font style="color:#00f">{{item.Shifoukecaozuo}}</font></span>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            </div> -->
            <div class="text item" style="line-height:180%;font-weight:bolder">
              对照检查材料（含班子主要负责人审签页）：
            </div>
            <div class="text item" style="line-height:180%">
                <span v-if="item.FileName&&item.FileName.length>0">
                  <div v-for="(filename,index) in item.FileName" :key="index">
                    <a href="javascript:void(0)" @click="showfile(filename,item.FilePathName[index])">{{filename}}</a><br>
                  </div>
                </span>
                <span v-else>无</span>
              <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
            </div>
            <div class="text item" style="line-height:180%;font-weight:bolder">
              备注：
            </div>
            <div class="text item" style="line-height:180%">
              {{item.Remark}}
            </div>
          </el-card>
      </div>
      <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
    </el-tab-pane>
  </el-tabs>
</template>
<script>
export default {
  props: {
    timestamp: ''
  },
  data () {
    return {
      topersonlist: [],
      activeNameHuiqian: 'Fangan',
      huiqiandata: {
        Fangan: {},
        HS_HuiYiYiCheng: {}
      },
      Fangansrc: '',
      showPDFVisible: false,
      YijianDuixiang: '全部',
      sublistLoading: false,
      listLoading: false,
      BanziPersonName: '全部',
      pdfviewersrc: '',
      TanhuaDuixiang: '全部',
      pdfpage: 1,
      FujianFilename: '',
      pdfviewersrcFujian: '',
      showPDFVisibleFujian: false
    }
  },
  watch: {
    timestamp (val) {
      this.loaddata()
    },
    '$store.state.link_hq' (val) {
      this.activeNameHuiqian = this.$store.state.link_hq
    }
    // $refs.tree2.getCurrentNode()
  },
  computed: {
    filterList: function () {
      let key = this.BanziPersonName
      let key2 = this.TanhuaDuixiang
      let oldList = this.huiqiandata.HQ_TanHua
      if (key === '全部' && key2 === '全部') {
        return oldList
      }
      if (key2 === '全部') {
        return oldList.filter(function (item) {
          return item.BanziPersonName === key
        })
      }
      if (key === '全部') {
        return oldList.filter(function (item) {
          return item.Duixiang === key2
        })
      }
      return oldList.filter(function (item) {
        return item.Duixiang === key2 && item.BanziPersonName === key
      })
    },
    dxfilterList: function () {
      let key = this.YijianDuixiang
      let oldList = this.huiqiandata.HQ_YiJianYuanShi
      if (key === '全部') {
        return this.huiqiandata.HQ_YiJianYuanShi
      }
      return oldList.filter(function (item) {
        return item.Fanweileixing === key
      })
    },
    SumYijianTiaoshu: function () {
      let s = 0
      if (this.dxfilterList) {
        this.dxfilterList.forEach(function (val) {
          s += val.Tiaoshu
        })
      }
      return s
    }
  },
  methods: {
    MyGetDateStr (date) { // author: meizz\
      let fmt = 'yyyy-MM-dd'
      if (date) {
        // date = date.replace(new RegExp(/-/gm), '/')
        let mydate = new Date(date)
        var o = {
          'M+': mydate.getMonth() + 1, // 月份
          'd+': mydate.getDate(), // 日
          'h+': mydate.getHours(), // 小时
          'm+': mydate.getMinutes(), // 分
          's+': mydate.getSeconds(), // 秒
          'q+': Math.floor((mydate.getMonth() + 3) / 3), // 季度
          'S': mydate.getMilliseconds() // 毫秒
        }
        if (/(y+)/.test(fmt)) { fmt = fmt.replace(RegExp.$1, (mydate.getFullYear() + '').substr(4 - RegExp.$1.length)) }
        for (var k in o) {
          if (new RegExp('(' + k + ')').test(fmt)) { fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) }
        }
        return fmt
      } else {
        return null
      }
    },
    changetopersonlist () {
      this.TanhuaDuixiang = '全部'
      let _this = this
      if (this.BanziPersonName === '全部') {
        this.topersonlist = _this.huiqiandata.HQ_TanHua_ToPerson
        console.log('this.topersonlist')
        console.log(this.topersonlist.length)
      } else {
        this.topersonlist = []
        this.huiqiandata.HQ_TanHua.forEach(function (item) {
          if (item.BanziPersonName === _this.BanziPersonName) {
            _this.topersonlist.push({Name: item.Duixiang})
          }
        })
      }
    },
    tabClick () {
      var params = {Link_hq: this.activeNameHuiqian}
      this.$store.commit('tablink_hq', params)
    },
    pinggushow () {
      var params1 = {Link1: 'Pingjia'}
      this.$store.commit('tablink1', params1)
    },
    showfile (filename, filepathname) {
      window.open(this.$http.defaults.baseURL + this.$http.defaults.shenghuohuiAPI + 'api/shenghuohui/getfujian?unitId=' + this.$route.params.id + '&filepathname=' + filepathname + '&filename=' + filename + '&t=' + new Date())
    },
    pdfshow () {
      window.open(this.basesrc + new Date())
    },
    dateFormat: function (row, column) {
      var date = row[column.property]
      if (date === undefined) {
        return ''
      }
      return this.MyGetDateStr(date)
    },
    loaddata: function () {
      let _this = this
      _this.listLoading = true
      // var personParams = { Page: 0, Pagenum: 20, Personname: '', Unitkey: '', Sortkey: '', Isace: true, timestamp: new Date().getTime() }
      this.$http
        .get(this.$http.defaults.shenghuohuiAPI + `api/shenghuohui2019/unitHuiQian?unitId=` + this.$route.params.id)
        .then(function (response) {
          _this.listLoading = false
          if (response.data.success === true) {
            console.log('获取成功')
            _this.huiqiandata = response.data.result
            _this.topersonlist = _this.huiqiandata.HQ_TanHua_ToPerson
            _this.changetopersonlist()
            if (_this.huiqiandata.Fangan.CanRead === true) {
              _this.basesrc = _this.$http.defaults.baseURL + _this.$http.defaults.shenghuohuiAPI + 'api/shenghuohui/getfanganpdf?unitId=' + _this.$route.params.id + '&t=' + new Date()
              _this.Fangansrc = _this.$http.defaults.baseURL + _this.$http.defaults.shenghuohuiAPI + 'api/shenghuohui/getfanganpdf?unitId=' + _this.$route.params.id + '&t=' + new Date()
              console.log('最新url：' + _this.Fangansrc)
            }
          } else {
            console.log('获取数据失败:' + response.data.message)
            _this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(function (error) {
          console.log(error)
          _this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
          _this.listLoading = false
        })
    }
  }
}
</script>
<style scoped>
.el-form-item{
  margin:0;
}
.el-table{
  border: 1px solid #95B8E7;
}
</style>

<style>
#tab-HQ_CaiLiaoBanZi.el-tabs__item{
  height:50px;
  line-height:120%;
  padding-top:10px;
}
</style>
